#ifndef HAND_H
#define HAND_H

class CardMgr;

class Hand
{
	public:
		Hand(CardMgr* Mgr);
		virtual ~Hand();

		bool8 add(uint8 Card);

		int32 out(uint8* Buf);
		int32 outlast(uint8* Buf);
		int32 outfirst(uint8* Buf);

		Hand* getNextHand();

		int32 getCount();
		uint8* getCards();
		uint8 getCardAt(int32 index);
		uint8 getLastCard();

		void restore(uint8* Cards, int32 Count);

        int32 outcard(int32, uint8*);

	protected:
		CardMgr* mgr;
		Hand* next;
		uint8 cards[52];
		int32 count;
};

inline
Hand::~Hand()
{
}

inline Hand*
Hand::getNextHand()
{
	return next;
}

inline int32
Hand::getCount()
{
	return count;
}

inline uint8*
Hand::getCards()
{
	return cards;
}

inline uint8
Hand::getLastCard()
{
	return getCardAt(count - 1);
}

#endif
